package com.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.entity.Ground;
import com.mapper.GroundMapper;
import com.service.GroundService;

@Service
public class GroundServiceImpl extends ServiceImpl<GroundMapper, Ground> implements GroundService{
    @Autowired
    GroundMapper groundMapper;

    @Override
    public List<Ground> getAllGround() {
        return groundMapper.selectList(null);
    }

    @Override
    public int insertGround(Ground ground) {
        System.out.println("进入insertGround"+ground);
        return groundMapper.insert(ground);
    }

    @Override
    public int deleteGround(Ground ground) {
        return groundMapper.deleteById(ground.getId());
    }

    @Override
    public int updateGround(Ground ground) {
        System.out.println("updateGround的ground:"+ground);
        return groundMapper.updateById(ground);
    }
}
